package com.md.domain.service;

import com.md.api.OpenUsersApi;
import com.md.base.exception.ServerException;
import com.md.response.LoginResponse;
import com.md.util.ObjectUtil;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@AllArgsConstructor
public class LoginDomainService {
  private final OpenUsersApi userClient;


  public LoginResponse loginPhoneCode(final String phone, final String code) {
    // todo 核销验证码
    //
    userClient.login()
    UsersPO users = usersRepository.queryUserByPhone(phone);
    if (ObjectUtil.isEmpty(users)) {
      throw ServerException.build(ErrorEnum.USERS_NOT_EXIST);
    }
    return null;
  }

  public LoginResponse loginAccountPassword(final String account, final String password) {
    return null;
  }

  public LoginResponse loginPhonePassword(final String phone, final String password) {
    return null;
  }

}
